/*
 * @Description:
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2021-09-07 17:02:42
 * @LastEditors: snzo.chen
 * @LastEditTime: 2021-09-16 16:50:03
 */
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable, map } from 'rxjs';
import { AnyJson } from './data-types/common.type';
import { ServicesModule } from './services.module';

@Injectable({
  providedIn: ServicesModule,
})
export class SystemService {
  constructor(private http: HttpClient) {}

  getAllAuth(): Observable<AnyJson> {
    return this.http.get('/menu/getAllAuth').pipe(map((res) => res as AnyJson));
  }

  getAllUser(): Observable<AnyJson> {
    return this.http.get('/menu/getAllUser').pipe(map((res) => res as AnyJson));
  }

  getSchNewsRecomSort(): Observable<AnyJson> {
    return this.http
      .get('/menu/getSchNewsRecomSort')
      .pipe(map((res) => res as AnyJson));
  }

  getSchNewsSort(): Observable<AnyJson> {
    return this.http
      .get('/menu/getSchNewsSort')
      .pipe(map((res) => res as AnyJson));
  }

  getspecNewsLable(): Observable<AnyJson> {
    return this.http
      .get('/menu/getspecNewsLable')
      .pipe(map((res) => res as AnyJson));
  }

  newsLabelList(): Observable<AnyJson> {
    return this.http
      .get('/menu/newsLabelList')
      .pipe(map((res) => res as AnyJson));
  }

  photoSortList(): Observable<AnyJson> {
    return this.http
      .get('/menu/photoSortList')
      .pipe(map((res) => res as AnyJson));
  }

  getFileSort(): Observable<AnyJson> {
    return this.http
      .get('/menu/getFileSort')
      .pipe(map((res) => res as AnyJson));
  }

  getOperLog(params: AnyJson): Observable<AnyJson> {
    return this.http
      .get('/display/getOperLog', { params })
      .pipe(map((res) => res as AnyJson));
  }

  getMeetactReviewSort(): Observable<AnyJson> {
    return this.http
      .get('/menu/getMeetactReviewSort')
      .pipe(map((res) => res as AnyJson));
  }
}
